﻿using System;
using System.Collections;
using System.Windows;

namespace Gmantis.Controls
{
    public class SelectionChangedEventArgs<T> : EventArgs
    {
        // Methods
        public SelectionChangedEventArgs(IOrderedSet<T> addedItems, IOrderedSet<T> removedItems)
        {
            this.AddedItems = addedItems;
            this.RemovedItems = removedItems;
        }

        // Properties
        public IOrderedSet<T> AddedItems { get; private set; }

        public IOrderedSet<T> RemovedItems { get; private set; }
    }

    public class SelectionChangedEventArgs : RoutedEventArgs
    {
        // Fields
        private object[] _addedItems;
        private object[] _removedItems;

        // Methods
        public SelectionChangedEventArgs(IList removedItems, IList addedItems)
        {
            if (removedItems == null)
            {
                throw new ArgumentNullException("removedItems");
            }
            if (addedItems == null)
            {
                throw new ArgumentNullException("addedItems");
            }
            this._removedItems = new object[removedItems.Count];
            removedItems.CopyTo(this._removedItems, 0);
            this._addedItems = new object[addedItems.Count];
            addedItems.CopyTo(this._addedItems, 0);
        }

        // Properties
        public IList AddedItems
        {
            get
            {
                return this._addedItems;
            }
        }

        public IList RemovedItems
        {
            get
            {
                return this._removedItems;
            }
        }
    }
}
